package com.xq.exception;

import com.xq.enums.DataBaseEnum;

/**
 * 自定义数据库异常
 * @version 0.1.0
 * @author wuven
 * @since 0.1.0
 * @date 2025/6/30 16:40
 **/

public class BusinessException extends RuntimeException {

    private final DataBaseEnum dataBaseEnum;

    public BusinessException(DataBaseEnum dataBaseEnum, DataBaseEnum dataBaseEnum1) {
        super(dataBaseEnum.getMessage());
        this.dataBaseEnum = dataBaseEnum1;
    }

    public BusinessException(DataBaseEnum dataBaseEnum, String message) {
        super(message);
        this.dataBaseEnum = dataBaseEnum;
    }

    public BusinessException(DataBaseEnum dataBaseEnum) {
        super(dataBaseEnum.getMessage());
        this.dataBaseEnum = dataBaseEnum;
    }

    public DataBaseEnum getDataBaseEnum() {
        return dataBaseEnum;
    }

}
